import java.util.Scanner;


class ArrayUtils{
	public static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
	}
	public static PairResult findMinMax(double[] values){
		ArrayUtils.PairResult x =new ArrayUtils.PairResult();
		x.max=values[0];
		x.min=values[0];
		for (int i = 0; i < values.length; i++) {
			if(x.max<values[i])
				x.max=values[i];
			if(x.min>values[i])
				x.min=values[i];
		}
		return x;
		
	}
}
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in 

);
		int n=Integer.parseInt(sc.nextLine());
		double[] str=new double[n];
		for (int i = 0; i < n; i++) {
			str[i]=sc.nextDouble();
		}
		ArrayUtils x=new ArrayUtils();
		System.out.println(x.findMinMax(str).toString());
		System.out.println(ArrayUtils.PairResult.class);
	}

}
